<template>
	<view>
		<view v-if="sears().length == 0">
			<image src="../../../static/nodata.png" mode="widthFix" style="width: 500upx;margin-left: 125upx;margin-top: 200upx;"></image>
		</view>
		<view v-else>
			<view class="seo">
				<input class="seos" type="text" v-model="sear" placeholder="输入任务名称"/>
				<image class="stb" src="../../../static/seo.png" mode=""></image>
			</view>
			<view>
				<view class="sneirong" v-for="(itam,index) in sears()" @click="tiao(itam.id)">
					<view class="neirong">
						<view class="nr_t">
							<view class="nr_ts f m-t3"><text>任务名称：</text><text>{{itam.name}}</text></view>
							<text class="nr_tc m-t3 wcl">起始时间：{{itam.startTime}}</text>
							<text class="nr_tc m-t1 wcl">结束时间：{{itam.endTime}}</text>
						</view>
						<text class="nr_jd">批阅进度：{{itam.schedule}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
 </template>
<script>
export default {
    data(){
        return{
            sear:'',
			you:true,
			renwu:[]
        }
    },
	created() {
		let that = this
		let params = {
		  "pageNo":1,
		  "pageSize":99999
		}
		that.pyReq(that.$http.getTeaTaskedList,params,function(res){
				  that.renwu = res.result
		});
		// let headers={
		// 	 'content-type': 'application/x-www-form-urlencoded',
		// 	 'token': uni.getStorageSync('token')
		// }
		//  uni.request({
		// 	  url: that.$http.getTeaTaskedList,
		// 	  method: 'POST',
		// 	  data: params,
		// 	  header: headers,
		// 	  success: (res)=>{
		// 		  console.log(res)
		// 		  that.renwu = res.data.result
		// 	  },
		// 	  fail: (err)=>{
		// 		  console.log(err)
		// 	  }
		// })  
	},
	computed:{
		Search(){
			if(this.sear){
				return this.renwu.filter((value) =>{
					return value.name.includes(this.sear)
				})
			}
		}
	},
    methods:{
		sears(){
			if(!this.sear){
				return this.renwu
			}
			return this.Search
		},
		tiao(id){
			uni.navigateTo({
				url:'./xshenglist?id='+id
			})
		}
    }
}
</script>
<style>
	.seo{
		position: relative;
		background: #B31610;
		height: 100upx;
		padding-top: 40upx;
	}
	.seos{
		width: 663upx;
		height: 60upx;
		border-radius: 10upx;
		background: #FFFFFF;
		margin: 0 auto;
		font-size: 24upx;
		padding-left: 47upx;
		box-sizing: border-box;
	}
	.stb{
		position: absolute;
		right: 74upx;
		top: 56upx;
		width: 28upx;
		height: 30upx;
	}
	.sneirong{
		margin: 0 auto;
		border: 1px solid #B31610;
		width: 659upx;
		/* height: 236upx; */
		border-radius: 15upx;
		margin-top: 30upx;
	}
	.neirong{
		margin: 20upx;
	}
	.nr_t{
		border-bottom: 1px solid #666666;
		padding-bottom: 20upx;
	}
	.nr_t text{
		display: block;
		overflow: hidden;
		text-overflow:ellipsis;
		white-space: nowrap;
	}
	.nr_ts{
		font-size: 27upx;
		font-weight: 700;
		line-height: 70upx;
	}
	.nr_ts{
		font-size: 27upx;
		line-height: 70upx;
	}
	.nr_jd{
		display: block;
		text-align: end;
		font-size: 29upx;
		color: #B31610;
		font-weight: 700;
		margin-top: 35upx;
	}
</style>